//
//  MessageTableViewCell.m
//  EDPS
//
//  Created by dllo on 15/12/5.
//  Copyright © 2015年 张维扬. All rights reserved.
//

#import "MessageTableViewCell.h"
#import "Height.h"

@interface MessageTableViewCell ()

@property (nonatomic,retain) UILabel *label;
@property (nonatomic,assign) CGFloat height;

@end

@implementation MessageTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self creatViews];
    }
    return self;
}
- (void)creatViews
{
    self.label = [[UILabel alloc] init];
    [self.contentView addSubview:self.label];
    
    
    
}
- (void)setText:(NSString *)text
{
    _text = text;
    self.label.text = _text;
    self.label.numberOfLines = 0;
   self.height =  [Height heightWithText:_text];
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.label.frame = CGRectMake(10, 10, ScreenWidth - 40, self.height);
}
@end
